package com.zlyx.easy.log;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;

import com.zlyx.easy.core.tool.Ops;
import com.zlyx.easy.log.handler.ILogHandler;
import com.zlyx.easy.log.model.LogModel;

/**
 * @Auth 赵光
 * @Describle
 * @2019年7月31日
 */
public class WebShowLogHander implements ILogHandler {

	@Autowired(required = false)
	private SimpMessagingTemplate messagingTemplate;

	@Override
	public void handle(List<LogModel> logModels) {
		if (messagingTemplate != null) {
			messagingTemplate.convertAndSend("/easyLog/show", Ops.toString(logModels, "<br>"));
		}
	}
}
